import { IsNotEmpty, IsString, Length } from 'class-validator';
export class CreateCategoryDto {
  @IsNotEmpty({
    message: '标题不能为空',
  }) //验证是否为空
  @IsString() //是否为字符串
  @Length(0, 20, {
    message: '字符长度不超过20',
  })
  name: string;

  @IsString()
  desc: string;
}
